// const APP_NAME = 'AT DEFI'
//
// document.title = APP_NAME
import 'vant/lib/index.css'
import './css/common.less'
import '@/page/Home/HomeView.less'

import { createApp } from 'vue'

import App from './App.vue'
import vant, { Toast } from 'vant'
import '@/utils/em-auto'
import './icons' // icon
import { router, setupRouter } from './router'
import { setupStore } from './store'
import { setupRouterGuard } from './router/guard'
import { setupI18n } from './locales/setupI18n'
import { startCheckUpdate } from '@/utils/check-update'

async function bootstrap() {
  const app = createApp(App)

  // Configure store
  setupStore(app)

  app.use(vant)

  window.Toast = Toast

  // Multilingual configuration
  // Asynchronous case: language files may be obtained from the server side
  await setupI18n(app)

  startCheckUpdate()

  // Configure routing
  setupRouter(app)

  // router-guard
  setupRouterGuard(router)

  app.mount('#app')
}

bootstrap()
